<div class="box">
    <div class="box-header">
        <h3 class="box-title">每日数据</h3><small><?php echo date('Y-m'); ?></small>
    </div><!-- /.box-header -->
    <div class="box-body">
        <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
            <div class="row">
                <div class="col-sm-6"></div>
                <div class="col-sm-6"></div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <table class="table table-bordered table-hover dataTable">
                        <thead>
                            <tr role="row">
                                <th class="sorting">日期</th>
                                <th class="sorting">文化广场店实收金额</th>
                                <th class="sorting">文化广场店成本</th>
                                <th class="sorting">文化广场店利润</th>
                                <th class="sorting">白露分店实收金额</th>
                                <th class="sorting">白露分店成本</th>
                                <th class="sorting">白露分店利润</th>
                                <th class="sorting">支出</th>
                                <th class="sorting">两店实收金额合计</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php

                        use modules\admin\FinanceModule;

                        $F = new FinanceModule();

                        $time = date('Y-m-');
                        $y = date('Y');
                        $m = date('m');
                        $d = date('d');

                        for ($i=1;$i<=$d;$i++){

                            if ($i < 10){
                                $i = "0".$i;
                            }

                            //获取文化广场店每日销售额
                            $w = $F->Day_Query('文化广场店',$time.$i);
                            //优化数据显示
                            $w_price = $w == NULL ? "0" : $w ;
                            //获取文化广场店每日成本
                            $wco = $F->Day_Cost('文化广场店',$time.$i);
                            //优化数据显示
                            $w_cost = $wco == NULL ? "0" : $wco ;
                            //计算文化广场店每日利润
                            $wpr = $w_price - $w_cost;
                            //优化数据显示
                            $w_profit = $wpr == NULL ? "0" :$wpr;

                            //获取白露店每日销售额
                            $b = $F->Day_Query('白露店',$time.$i);
                            //优化数据显示
                            $b_price = $b == NULL ? "0" : $b ;
                            //获取白露店每日成本
                            $bco = $F->Day_Cost('白露店',$time.$i);
                            //优化数据显示
                            $b_cost = $bco == NULL ? "0" : $bco ;
                            //计算白露店每日利润
                            $bpr = $b_price - $b_cost;
                            //优化数据显示
                            $b_profit = $bpr == NULL ? "0" :$bpr;

                            //合计
                            $sum = $w_price + $b_price;
                            ?>
                            <tr>
                                <td>
                                    <?php echo $m.'月'.$i.'日';?>
                                </td>
                                <td>
                                    <?php echo $w_price;#文化广场店销售额?>
                                </td>
                                <td>
                                    <?php echo $w_cost;#文化广场店成本 ?>
                                </td>
                                <td>
                                    <?php echo $w_profit;#文化广场店利润 ?>
                                </td>
                                <td>
                                    <?php echo $b_price;#白露店销售额?>
                                </td>
                                <td>
                                    <?php echo $b_cost;#白露店成本 ?>
                                </td>
                                <td>
                                    <?php echo $b_profit;#白露店利润 ?>
                                </td>
                                <td>
                                    <?php echo "待开发";?>
                                </td>
                                <td>
                                    <?php echo $sum;#总计?>
                                </td>
                            </tr>
                        <?php } ?>
                        </tbody>
                        <tfoot>
                        <th class="sorting">日期</th>
                        <th class="sorting">文化广场店</th>
                        <th class="sorting">文化广场店成本</th>
                        <th class="sorting">文化广场店利润</th>
                        <th class="sorting">白露分店</th>
                        <th class="sorting">白露分店成本</th>
                        <th class="sorting">白露分店利润</th>
                        <th class="sorting">支出</th>
                        <th class="sorting">合计</th>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div><!-- /.box-body -->
    </div>
</div>